package com.jqkb.adapters;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.jqkb.fragments.FAllFragment;
import com.jqkb.fragments.FSendedFragment;
import com.jqkb.fragments.FTargetFragment;


/**
 * Created by alimjantursun on 18/5/29.
 */
public class ForwardPagerAdapter extends FragmentPagerAdapter {
    private final Context context;

    public ForwardPagerAdapter(FragmentManager supportFragmentManager, Context context) {
        super(supportFragmentManager);
        this.context = context;
    }

    @Override
    public Fragment getItem(int position) {


        Fragment fragment=null;
        if (position==0) {
            fragment= FAllFragment.getInstance(context);
        }
        else if (position==1) {
            fragment= FSendedFragment.getInstance(context);
        }
        else{
            fragment= FTargetFragment.getInstance(context);
        }
        return fragment;
    }

    @Override
    public int getCount() {
        return 3;
    }
}